package cn.genmer.test.security.rpc.v2.rpc;

import java.util.concurrent.ConcurrentHashMap;

public class Dispatcher {

    private static Dispatcher dispatcher;
    static {
        dispatcher = new Dispatcher();
    }
    public static Dispatcher getDispatcher(){
        return dispatcher;
    }
    public static ConcurrentHashMap<String, Object> invokeMap = new ConcurrentHashMap();

    public void register(String key, Object obj){
        invokeMap.put(key,obj);
    }

    public Object get(String key){
        return invokeMap.get(key);
    }

    public int getServiceSize(){
        return invokeMap.size();
    }
}
